package refactor.extractsuperclass;

import java.util.List;

public class Department extends Party {
    private List<Employee> staff;

    public Department(String name) {
        super(name);
    }

    public List<Employee> getStaff() {
        return staff;
    }

    @Override
    public int getAnnualCost() {
        int result = 0;
        for (Party employee : staff) {
            result += employee.getAnnualCost();
        }
        return result;
    }

    public void addStaff(Employee employee) {
        staff.add(employee);
    }
}
